package com.itheima.test;

import java.util.Scanner;

public class Test25 {
    public static void main(String[] args) {
        //需求：不使用乘法，除法和 % 运算符，得到商和余数

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入被除数：");
        int bedivnumble = sc.nextInt();
        System.out.println("请输入除数：");
        int divnumble = sc.nextInt();
        int count = 0;
        while (bedivnumble >= divnumble){
            bedivnumble -= divnumble;
            count++;
        }
        System.out.println("商：" + count);
        System.out.println("余数：" + bedivnumble);
    }
}
